package com.inspinia.message.common.model;


import com.inspinia.base.common.model.NameCodeEnum;

/**
 * @author Veblen
 */

public enum NoticeType implements NameCodeEnum {
    sys(1, "系统通知"),
    normal(2, "普通通知"),
    maintain(3, "运维通知");

    private final int code;
    private final String name;

    NoticeType(int code, String name) {
        this.code = code;
        this.name = name;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getName() {
        return this.name;
    }

    public static NoticeType valueOf(int code) {
        for (NoticeType rs : NoticeType.values()) {
            if (rs.getCode() == code) {
                return rs;
            }
        }
        return null;
    }


}

